<div class="ui-widget"  >
	<label for="testId" >Select Test</label>
	<select id="testId" class="ui-widget ui-widget-content ui-corner-all" >
		<option value="-1" >----Selecte Test----</option>
		<?php
			if($this->tests):
				foreach ($this->tests as $test):
					?><option <?php echo ($test->id == $this->testId) ? 'selected="selected"': '';?>  value="<?php echo $test->id;?>" ><?php echo $this->escape($test->name.' -- '.$test->subject);?></option><?php
				endforeach;
			endif; 
		?>
	</select>
	<br /><br />
	<div id="questionsTable" ><?php $this->partial('table');?></div>
</div>
<script type="text/javascript" >
$(function(){
	$('#testId').change(function(){
		$.ajax({
			url: "<?php echo $this->url(array('ctrl' => $this->controllerName, 'act' => 'table'));?>",
			data: 'testId='+this.value,
			success: function(htmlFromServer){
				$('#questionsTable').html(htmlFromServer);
			}
		});
	});
})
</script>